import 'package:flutter/material.dart';
import 'package:package_model/base_adapter.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

/**
 *
 * @ProjectName:    person_model_project
 * @ClassName:      main_toppic_adapter
 * @Description:    dart类作用描述
 * @Author:         孙浩
 * @QQ:             243280864
 * @CreateDate:     2021/2/1 12:05 AM
 */
class MainTopicAdapter extends BaseAdapter<String> {
  MainTopicAdapter(int index, String data) : super(index, data);

  @override
  buildChild(String data) => Container(
        child: Row(
          children: [
            SizedBox(
              height: 100.w,
              width: 100.w,
              child: ClipRRect(
                borderRadius: BorderRadius.circular(12.w),
                child: ConstrainedBox(
                  constraints: BoxConstraints.expand(),
                  child: Image.network(
                    "https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1564429550,1659123573&fm=26&gp=0.jpg",
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ),
            SizedBox(width: 24.w,),
            SizedBox(
              height: 100.w,
              child: Column(
                children: [
                  Text("专题名称",maxLines: 1,overflow: TextOverflow.ellipsis,),
                  Text(
                    "1篇攻略\t28浏览",
                    style: TextStyle(fontSize: 24.sp, color: Colors.grey),
                  )
                ],
                crossAxisAlignment: CrossAxisAlignment.start,
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              ),
            )
          ],
        ),
        margin: EdgeInsets.symmetric(horizontal: 44.w).copyWith(bottom: 20.w),
      );
}
